#ifndef APPLYFRIENDREQUESTMESSAGETOCLIENT_H
#define APPLYFRIENDREQUESTMESSAGETOCLIENT_H

#include "./entities/message/superClass/message.h"

/*
Json数据格式
{
    "messageType": [ApplyFriendRequestToClient](int)
    "userId": [userId](string)
    "friendId": [friendId](string)
    "nickname": [nickname](string)
    "verifyInfo": [verifyInfo](string)
    "createTime": [applyTime](string)
    "id": [id](int) 这个字段用来确保收到客户端收到好友请求消息
}
*/
class ApplyFriendRequestMessageToClient : public Message
{
public:
    ApplyFriendRequestMessageToClient() = delete;

    ApplyFriendRequestMessageToClient(const UserId& receiverId, const FriendId& applicantId, \
                                    const Nickname& nickname, const VerifyInfo& verifyInfo,
                                    const CreateTime& applyTime, const Id& id);
    ApplyFriendRequestMessageToClient(const QJsonObject&);
    QJsonObject PackJsonData() const override;
    UserId getReceiverId() const;
    FriendId getApplicantId() const;
    Nickname getNickname() const;
    VerifyInfo getVerifyInfo() const;
    CreateTime getApplyTime() const;
    Id getId() const;

private:
    UserId m_receiverId;
    FriendId m_applicantId;
    Nickname m_nickname;
    VerifyInfo m_verifyInfo;
    CreateTime m_applyTime;
    Id m_id;
};

// 编译时注册
Q_DECLARE_METATYPE(ApplyFriendRequestMessageToClient)

#endif // APPLYFRIENDREQUESTMESSAGETOCLIENT_H
